﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Data.SqlClient;
using Entity;
using Business; 


namespace WebApp
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Add_cus(object sender, EventArgs e)
        {
            
            Customer_Entity cus = new Customer_Entity();
            Customer_Business Insert = new Customer_Business();

            cus.Username = txtuser.Text.Trim();
            cus.Password = txtpass.Text.Trim();
            cus.Name = txtname.Text.Trim();
            cus.Address = txtaddress.Text.Trim();
            cus.Phone = Convert.ToInt32(txtphone.Text.ToString());
            //cus.Phone = Int32.Parse(txtphone.Text);



            Insert.Add_Customer(cus);

            //Bindcus();


            Response.Redirect("RegisterSuccess.aspx");
           
        }
        protected void ResetAllFields(object sender, EventArgs e)
        {
            txtuser.Text = "";
            txtpass.Text = "";
            txtname.Text = "";
            txtaddress.Text = "";
            txtphone.Text = "";

        }

        protected void btncancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("Home.aspx");
        }
    }
}